placessidebar: show Computer item when not in Other Locations
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 20 Jul 2015 01:09:29 +0000 (22:09 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 27 Jul 2015 15:21:36 +0000 (12:21 -0300)
Previous commits removed from places sidebar the code related
to displaying the Computer item, which should be shown when
the sidebar is not displaying the Other Locations item.

Add back the item when the sidebar is not in Other Locations'
mode.

gtk/gtkplacessidebar.c

index 67c5c222edf6dd92d432adf5954e55a480a1e16b..08e28b68b08b5aa0d77b90059478cb8372175a07 100644 (file)
@@ -1133,6 +1133,19 @@ update_places (GtkPlacesSidebar *sidebar)
     }
   g_list_free (volumes);
 
+  /* file system root */
+  if (!sidebar->show_other_locations)
+    {
+      mount_uri = "file:///"; /* No need to strdup */
+      icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_FILESYSTEM);
+      add_place (sidebar, PLACES_BUILT_IN,
+                 SECTION_MOUNTS,
+                 sidebar->hostname, icon, mount_uri,
+                 NULL, NULL, NULL, 0,
+                 _("Open the contents of the file system"));
+      g_object_unref (icon);
+    }
+
   /* add mounts that has no volume (/etc/mtab mounts, ftp, sftp,...) */
   mounts = g_volume_monitor_get_mounts (sidebar->volume_monitor);